/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jprojetocloseup;

/**
 *
 * @author Toma
 */
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;

import javax.swing.JProgressBar;

/**
 *
 * @author Rodrigo Toma
 */
public class BarraProgresso {
   
   JProgressBar pbar = new JProgressBar();
   JLabel imageLabel = new JLabel();
    
    public void mostraBarra(){
        
        
        ImageIcon ii = new ImageIcon(this.getClass().getResource(
                    "carregando.gif"));
            imageLabel.setIcon(ii);

                
        JFrame frame = new JFrame("");  
        frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);  
        frame.setLocationRelativeTo(null);
        frame.setContentPane(pbar);  
        frame.pack();
        frame.setContentPane(imageLabel);
        frame.pack();  
        frame.setVisible(true);  
        
        frame.setLocation(400, 300); 
                
    }
    public void preencheBarra(int valor){
        
        pbar.setValue(valor);
        
    }
    
    
    
    
    
}

